package com.base.controller;

import com.base.po.voip.UsersReleaseConfig;
import com.base.service.UsersReleaseConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;

/**
 * 分销配置
 *
 */
@Controller
@RequestMapping("/admin")
public class UsersReleaseConfigIndexController {

	@Autowired
	private UsersReleaseConfigService usersReleaseConfigService; // 账户信息Service

	// 账户配置主页
	@RequestMapping("/release_config_index")
	public ModelAndView releaseIndex(HttpServletRequest request, HttpSession session) {
		Object obj_id = session.getAttribute("adminUserId"); // 登录的用户ID
		if (obj_id == null) {
			return new ModelAndView("jsp/loginCheck"); // 未登录
		}
		UsersReleaseConfig releaseConfig = usersReleaseConfigService.selectByParentId((String) obj_id);
		return new ModelAndView("jsp/release_config_index", "config", releaseConfig);
	}
}
